package com.itheima.service.system;

import com.github.pagehelper.PageInfo;
import com.itheima.domain.system.User;

import java.util.List;
import java.util.Map;

/**
 * @Author:Mr.yuan
 * @Description:
 * @Date: Created in 22:12 2020/11/29
 * @ModifiedBy:
 */
public interface UserService {

    /**
     * @Description:  登录
     * @Param: [user]
     * @return: com.itheima.domain.system.User
     * @Author: Mr.yuan
     * @Date: 2020/11/30
     */
    User login(User user);

    /**
     * @Description:  通过id查询用户
     * @Param: [id]
     * @return: java.util.List<com.itheima.domain.system.User>
     * @Author: Mr.yuan
     * @Date: 2020/11/30
     */
    User findById(String id);

    /**
     * @Description:  修改用户密码
     * @Param: [user]
     * @return: void
     * @Author: Mr.yuan
     * @Date: 2020/11/30
     */
    void updatePWD(User user);

    /**
         * @Description:  根据用户名称模糊查询所有
         * @Param:[username, pageNum, pageSize]
         * @return:com.github.pagehelper.PageInfo<com.itheima.domain.system.User>
         * @Author:Mr.Cheng
         * @Date:2020/11/30
         */
    PageInfo<User> findAllByUserNameLike(String username, int pageNum, int pageSize);

    /**
         * @Description:  新增用户
         * @Param:[user]
         * @return:void
         * @Author:Mr.Cheng
         * @Date:2020/11/30
         */
    void save(User user);

    /**
         * @Description:  批量删除用户
         * @Param:[userId]
         * @return:void
         * @Author:Mr.Cheng
         * @Date:2020/11/30
         */
    void delete(String userId);

    /**
         * @Description:  根据id查找用户
         * @Param:[userId]
         * @return:com.itheima.domain.system.User
         * @Author:Mr.Cheng
         * @Date:2020/11/30
         */
    User findByUserId(String userId);
    /**
         * @Description:  根据id查找用户属性
         * @Param:[userId]
         * @return:java.util.List<java.util.Map>
         * @Author:Mr.Cheng
         * @Date:2020/11/30
         */
    List<Map> findAllRoleByUserId(String userId);

    /**
         * @Description:  将配置好的用户属性进行保存
         * @Param:[roleIds, userId]
         * @return:void
         * @Author:Mr.Cheng
         * @Date:2020/11/30
         */
    void saveRoleToUser(String[] roleIds, String userId);

    /**
         * @Description: 修改用户
         * @Param:[users]
         * @return:void
         * @Author:Mr.Cheng
         * @Date:2020/11/30
         */
    void update(User users);
/**
 * @Description:  獲取手機驗證碼
 * @Param: [phoneNum]
 * @return: java.lang.String
 * @Author: Mr.yuan
 * @Date: 2020/12/1
 */
    String findPW(String phoneNum);
/**
 * @Description:  設置手機驗證碼
 * @Param: [phoneNum]
 * @return: void
 * @Author: Mr.yuan
 * @Date: 2020/12/1
 */
    void setPhoneCode(String phoneNum);
/**
 * @Description:   通過手機查詢用戶
 * @Param: [phoneNum]
 * @return: com.itheima.domain.system.User
 * @Author: Mr.yuan
 * @Date: 2020/12/1
 */
    User findByPhone(String phoneNum);

     /**
          * @Description: 根据用户id查询该用户具有的所有权限信息
          * @Param:
          * @return:
          * @Author: gjp
          * @Date:  2020/12/01
          */
     List<String> findAllPermissionUrlByUserId(String userId);
}
